package is.model.bean;

import is.interfaces.Bean;
import is.model.exceptions.EmptyValueException;

/**
 *
 * @author aspr0
 */
public abstract class AbstractBean implements Bean, Cloneable
{
    public final String KEY_FIELD = "id";
    protected Integer id;
    protected String tableName;
    protected String[] fields;

    @Override
    public Integer getId()
    {
        return id;
    }

    @Override
    public void setId(Integer id) throws EmptyValueException
    {
        this.id = id;
    }

    @Override
    public String getTableName()
    {
        return tableName;
    }

    @Override
    public String[] getFields()
    {
        return fields;
    }

    @Override
    public Object clone()
    {
        Object clone = null;

        try
        {
            clone = super.clone();
        }
        catch (CloneNotSupportedException ex)
        {
            ex.printStackTrace();
        }

        return clone;
    }
}
